<div id="main">
    <div id="contents_stat">
        <form method="post" action="#" name="filters">
            <fieldset>
                <legend>
                    <label sid="menu.systime"></label>
                </legend>
                <div class="frame_tab_layer">
                    <table class="cmenutitle" cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tbody>
                        <tr>
                            <td class="frame_tab_left">
                                <label for="id2362">
                                    <label sid="systime.NTPValid"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id2362" type="text" readonly="true" name="id2362">
                                <span style="padding-left:20px;"></span>
                                <input class="button" type="button" onclick="syncWithHost();" name="sync" sid="systime.NTPSync">
                            </td>
                        </tr>
                        <tr>
                            <td class="frame_tab_left">
                                <label for="id2335">
                                    <label sid="members.param1"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id2335" type="text" name="id2335">
                            </td>
                        </tr>
                        <tr>
                            <td class="frame_tab_left">
                                <span id="img2332" class="errormsg"></span>
                                <label for="id2332">
                                    <label sid="systime.timezone"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <select id="id2332" name="id2332">
                                    <option id="manNTPMidIsland" value="UCT_-11">(GMT-11:00) Midway Island, Samoa</option>
                                    <option id="manNTPHawaii" value="UCT_-10">(GMT-10:00) Hawaii</option>
                                    <option id="manNTPAlaska" value="NAS_-09">(GMT-09:00) Alaska</option>
                                    <option id="manNTPPacific" value="PST_-08">(GMT-08:00) Pacific Time</option>
                                    <option id="manNTPMountain" value="MST_-07">(GMT-07:00) Mountain Time</option>
                                    <option id="manNTPArizona" value="MST_-07">(GMT-07:00) Arizona</option>
                                    <option id="manNTPCentral" value="CST_-06">(GMT-06:00) Central Time</option>
                                    <option id="manNTPMidUS" value="UCT_-06">(GMT-06:00) Middle America</option>
                                    <option id="manNTPIndianaEast" value="UCT_-05">(GMT-05:00) Indiana East, Colombia</option>
                                    <option id="manNTPEastern" value="EST_-05">(GMT-05:00) Eastern Time</option>
                                    <option id="manNTPAtlantic" value="AST_-04">(GMT-04:00) Atlantic Time, Brazil West</option>
                                    <option id="manNTPBolivia" value="UCT_-04">(GMT-04:00) Bolivia, Venezuela</option>
                                    <option id="manNTPGuyana" value="UCT_-03">(GMT-03:00) Guyana</option>
                                    <option id="manNTPBrazilEast" value="EBS_-03">(GMT-03:00) Brazil East, Greenland</option>
                                    <option id="manNTPMidAtlantic" value="NOR_-02">(GMT-02:00) Mid-Atlantic</option>
                                    <option id="manNTPAzoresIslands" value="EUT_-01">(GMT-01:00) Azores Islands</option>
                                    <option id="manNTPGambia" value="UCT_000">(GMT) Gambia, Liberia, Morocco</option>
                                    <option id="manNTPEngland" value="GMT_000">(GMT) England</option>
                                    <option id="manNTPCzechRepublic" value="MET_001">(GMT+01:00) Czech Republic, N</option>
                                    <option id="manNTPGermany" value="MEZ_001">(GMT+01:00) Germany</option>
                                    <option id="manNTPTunisia" value="UCT_001">(GMT+01:00) Tunisia</option>
                                    <option id="manNTPGreece" value="EET_002">(GMT+02:00) Greece, Ukraine, Turkey</option>
                                    <option id="manNTPSouthAfrica" value="SAS_002">(GMT+02:00) South Africa</option>
                                    <option id="manNTPIraq" value="IST_003">(GMT+03:00) Iraq, Jordan, Kuwait</option>
                                    <option id="manNTPMoscowWinter" value="MSK_003">(GMT+03:00) Moscow Winter Time</option>
                                    <option id="manNTPArmenia" value="UCT_004">(GMT+04:00) Armenia</option>
                                    <option id="manNTPPakistan" value="UCT_005">(GMT+05:00) Pakistan, Russia</option>
                                    <option id="manNTPBangladesh" value="UCT_006">(GMT+06:00) Bangladesh, Russia</option>
                                    <option id="manNTPThailand" value="UCT_007">(GMT+07:00) Thailand, Russia</option>
                                    <option id="manNTPChinaCoast" value="CST_008">(GMT+08:00) China Coast, Hong Kong</option>
                                    <option id="manNTPTaipei" selected="" value="CCT_008">(GMT+08:00) Beijing</option>
                                    <option id="manNTPSingapore" value="SST_008">(GMT+08:00) Singapore</option>
                                    <option id="manNTPAustraliaWA" value="AWS_008">(GMT+08:00) Australia (WA)</option>
                                    <option id="manNTPJapan" value="JST_009">(GMT+09:00) Japan, Korea</option>
                                    <option id="manNTPKorean" value="KST_009">(GMT+09:00) Korean</option>
                                    <option id="manNTPGuam" value="UCT_010">(GMT+10:00) Guam, Russia</option>
                                    <option id="manNTPAustraliaQLD" value="AES_010">(GMT+10:00) Australia (QLD, TAS,NSW,ACT,VIC)</option>
                                    <option id="manNTPSolomonIslands" value="UCT_011">(GMT+11:00) Solomon Islands</option>
                                    <option id="manNTPFiji" value="UCT_012">(GMT+12:00) Fiji</option>
                                    <option id="manNTPNewZealand" value="NZS_012">(GMT+12:00) New Zealand</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="frame_tab_left">
                                <label for="DMZTCPPort80">
                                    <label sid="systime.NTPServerIP"></label>
                                </label>
                            </td>
                            <td class="frame_tab_right">
                                <input id="id2334" type="text" name="id2334">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </fieldset>
            <div class="submitFooter">
                <script type="text/javascript">
                    var buttonInfo = submitFooterButton(1,0);
                    $(".submitFooter").html(buttonInfo);
                </script>
            </div>
        </form>
    </div>
</div>

<script type="text/javascript">
	var nonames = new Array("submit","sync","id2362");
	var sendtext = getSendText(nonames);
	DataRequest("get_json",sendtext,function(data){
  	getResult(nonames,data);
  });
 
 $.ajax({
		type:"POST",url:"status?get&param=WROC_date",dataType:"text",error:function (xml) {
			$(xml).find('Error').each(function () {
				var errortext = $(this).attr('msg');
				//show_message("err",errortext);
				alert(errortext);
			});
		},success:function (xml) {
		 $("#id2362").attr("value",xml);
		}
	});
	
	function syncWithHost()
{
	var currentTime = new Date();

	var seconds = currentTime.getSeconds();
	var minutes = currentTime.getMinutes();
	var hours = currentTime.getHours();
	var month = currentTime.getMonth() + 1;
	var day = currentTime.getDate();
	var year = currentTime.getFullYear();

	var seconds_str = " ";
	var minutes_str = " ";
	var hours_str = " ";
	var month_str = " ";
	var day_str = " ";
	var year_str = " ";

	if(seconds < 10)
		seconds_str = "0" + seconds;
	else
		seconds_str = ""+seconds;

	if(minutes < 10)
		minutes_str = "0" + minutes;
	else
		minutes_str = ""+minutes;

	if(hours < 10)
		hours_str = "0" + hours;
	else
		hours_str = ""+hours;

	if(month < 10)
		month_str = "0" + month;
	else
		month_str = ""+month;

	if(day < 10)
		day_str = "0" + day;
	else
		day_str = day;

	var tmp = month_str + day_str + hours_str + minutes_str + year + " ";
	var pctime = year+"-"+month_str+"-"+day_str+" "+hours_str +":"+minutes_str+":"+seconds_str;
	$("#id2362").attr("value",pctime);
	submitform(modules["set_data"],"&id2362="+tmp);
}
	
	$("[name=submit]").click(function () {
		$(".errormsg").html('');
		var nonames = new Array("submit","sync","id2362");
		var settext = getSetText(nonames);
		settext=settext.replace(/\#/g,"%23");
		submitform(modules["set_data"],settext);
	});
	

</script>
